<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/config/tld/mysoft.tld" prefix="mysoft"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>分类添加</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/jquery-1.4.2.min.js" />
	
	
	
	
	</head>

	<body>
		<form action="saveEditUrl.action" enctype="multipart/form-data" method="post">
			<s:hidden name="editUrlManager.URL_ID"></s:hidden>
			名称：
			<s:textfield name="editUrlManager.URL_NAME"></s:textfield>
			<br />
			URL:
			<s:textarea name="editUrlManager.URL_URL"></s:textarea>
			<br />
			描述:
			<s:textarea name="editUrlManager.URL_DESC"></s:textarea>
			<br />
			所属分类:
			<s:select list="allUrlClass" listKey="CLASS_ID"
				listValue="CLASS_NAME" theme="simple" name="editUrlManager.CLASS_ID">
			</s:select>
			<br />
			html:
			<s:textarea name="editUrlManager.URL_HTML"></s:textarea>
			<br />
			类型:
			<s:select list="urltypeDictionaryManagers" listKey="NAME"
				listValue="VALUE" theme="simple" name="editUrlManager.URL_TYPE">
			</s:select>
			<br />
			显示类型:
			<s:select list="urlshowtypeDictionaryManagers" listKey="NAME"
				listValue="VALUE" theme="simple" name="editUrlManager.SHOW_STATUS">
			</s:select>
			<br />
			图片信息:

			<s:hidden name="editUrlManager.URL_ICONID" />
			<span id="deleteImage"> <a
				href="javascript:deleteImage(<s:property value="editUrlManager.URL_ICONID"/>)">删除图片信息</a>
				<br/>
				<img alt=""
				src="<s:url action="showImage.action">
				<s:param name="imageID" value="editUrlManager.URL_ICONID"/>
			</s:url>">
			</span>
			
			<br />

			<input type="submit" value="保存" />
			&emsp;&emsp;&emsp;
			<input type="reset" value="重置" />
		</form>
	</body>
	<script>
	function deleteImage(obj) {
		var readyFunction = doImageDeleteing;
		var param = "imageID=" + obj;
		$.ajax( {
			type : "POST",
			url : "deleteUrlImage.action",
			data : param,
			success : readyFunction
		});
	}

	function doImageDeleteing(msg) {
		if ("true" == msg) {
			var successString = '<input type="file" name="imageFile" value="" id="imageFile"/>';
			document.getElementById("deleteImage").innerHTML = successString
		} else {
			alert("图片删除失败!");
		}

	}
</script>
</html>
